package com.jt.controller;

import com.jt.pojo.User;
import com.jt.service.Userservice;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@CrossOrigin
@RequestMapping("/user")
public class UserController {
    @Autowired
    private Userservice userservice;

    @GetMapping("/findAll")
    public List<User> findAll(){
        return userservice.findAll();
    }
    @DeleteMapping("/finddelete/{id}")
    public void findAll1(@PathVariable Integer id){
        userservice.findAll1(id);
    }

    @GetMapping("/find")
    public List<User> findAll1(){
        return userservice.find();
    }


}
